<include file="header"/>

<div ng-controller="UserLoginController" id="b-login">
    <div class="wrap">
        <div class="box">
            <div class="head">
                <h1>用户登录</h1>
            </div>
            <div class="body">
                <?php if(tpx_config_get('cas_login_enable',false)){ ?>
                    <div style="padding:40px 0;">
                        <div style="padding:20px 0;font-size:14px;color:#999;">
                            您已经开启CAS登录,请直接点击登录
                        </div>
                        <a class="btn btn-default btn-block" href="{:U('User/cas')}">点击登录</a>
                    </div>
                <?php }else{ ?>
                <form ng-submit="submit(form.$valid)" novalidate name="form">
                    <div class="form-group"
                         ng-class="{'has-error':!form.username.$pristine && form.username.$invalid && form.username.$focused}">
                        <label for="username">用户</label>
                        <input type="text" class="form-control" id="username" name="username" ng-model="data.username"
                               required="true" ng-focus/>
                    </div>
                    <div class="form-group"
                         ng-class="{'has-error':!form.password.$pristine && form.password.$invalid && !form.password.$focused}">
                        <label for="password">密码</label>
                        <input type="password" class="form-control" id="password" name="password"
                               ng-model="data.password" ng-minlength="1" required="true" ng-focus/>
                    </div>
                    <button type="submit" class="btn btn-primary btn-block" ng-disabled="form.$invalid">登录</button>
                </form>
                <?php } ?>
            </div>
        </div>
    </div>
</div>

<include file="icons" />

<include file="footer"/>